import request from '@/utils/request'
import { deletefn, deletefn1, get } from '@/utils/request'

// 房屋信息
export function getHouseInfo(page, limit) {
    return get('/api-user/tbHouse', {
      page,
      limit
    })
}
// 房屋信息，是否被新建招商信息
export function getHouseInfoByStatus(page, limit, issueStatus) {
  return get('/api-user/tbHouse', {
    page,
    limit,
    issueStatus
  })
}
export function addHouseInfo(data) {
    return request({
      url: '/api-user/tbHouse',
      method: 'post',
      data
    })
}

export function delHouseInfoById(id) {
    return deletefn('/api-user/tbHouse/delete/' + id)
}

export function delHouseInfoByIdList(idList) {
    return deletefn1('/api-user/tbHouse/deleteList', {
        list: idList
    })
}
export function putHouseInfofoById(data) {
    return request({
      url: '/api-user/tbHouse',
      method: 'put',
      data
    })
  }
  

// 楼宇管理
export function getBuildingInfo(page, limit) {
    return get('/api-user/tbBuilding', {
      page,
      limit
    })
}
export function addBuildingInfo(data) {
    return request({
      url: '/api-user/tbBuilding',
      method: 'post',
      data
    })
}

export function putBuildingInfoById(data) {
    return request({
      url: '/api-user/tbBuilding',
      method: 'put',
      data
    })
  }
  
export function delBuildingInfoById(id) {
    return deletefn('/api-user/tbBuilding/delete/' + id)
}
export function delBuildingInfoByIdList(idList) {
    return deletefn1('/api-user/tbBuilding/deleteList', {
        list: idList
    })
  }

// 园区信息

export function getParkInfo() {
  return get('/api-user/tbPark', {
  })
}

// 修改密码
export function updatePassword(data) {
  return request({
    url: '/api-user/users/updatePassword',
    method: 'put',
    data
  })
}

// 修改园区信息
export function putParkInfo(data) {
  return request({
    url: '/api-user/tbPark/updateTbPark',
    method: 'put',
    data
  })
}